print('=' * 30, 'While循环第一种方法(左下角)', '=' * 30)

i = 1
while i < 10:
    j = 1
    while j <= i:
        print('{0}*{1}={2:<4}'.format(i, j, i * j), end='')
        j += 1
    print('')
    i += 1

print('=' * 30, 'While循环第二种方法(左上角)', '=' * 30)
i = 9
while i > 1:
    j = 1
    while j <= i:
        print('{0}*{1}={2:<4}'.format(i, j, i * j), end='')
        j += 1
    print('')
    i -= 1

print('=' * 30, 'While循环第三种方法(右下角)', '=' * 30)
i = 1
while i < 10:
    k = 1
    while k <= 9 - i:
        print("        ", end="")
        k += 1
    j = 9
    while j > 9 - i:
        print('{0}*{1}={2:<4}'.format(i, j, i * j), end='')
        j -= 1
    print('')
    i += 1

print('=' * 30, 'While循环第四种方法(右上角)', '=' * 30)
i = 9
while i > 1:
    k = 1
    while k <= 9 - i:
        print("        ", end="")
        k += 1
    j = 9
    while j > 9 - i:
        print('{0}*{1}={2:<4}'.format(i, j, i * j), end='')
        j -= 1
    print('')
    i -= 1
